function mylogin () {
    var username = $.trim($("#username").val());
	var password = $.trim($("#password").val());
    var params = "username=" + username + "&password=" + password;

    $.ajax({
        type: "post",
        url: '/users/userLogin',
        dataType: "json",
        timeout: 7000,
        data: params,
        success: function(msg) {
            if(msg.sign == true){
                $("#loginBox").hide();
                $("#userInfoBox").show();
                $("#infoname").html(username);
            }else{
                alert(msg.loginErrorMsg);
            }
        },
        error: function() {
            alert('数据读取错误..');
        }
    });
};


function myCartLogin () {
    var username = $.trim($("#username").val());
	var password = $.trim($("#password").val());
    var params = "username=" + username + "&password=" + password;

    $.ajax({
        type: "post",
        url: '/users/userLogin',
        dataType: "json",
        timeout: 7000,
        data: params,
        success: function(msg) {
            if(msg.sign == true){
            	window.location.href="/orders/add/";
            }else{
                alert(msg.loginErrorMsg);
            }
        },
        error: function() {
            alert('数据读取错误..');
        }
    });

};
